package com.yzd.learnjava.typeinfo;

import com.yzd.learnjava.util.Print;
/*
 * Class.forName()
 */
public class SweetShop {
	public static void main(String[] args) {
		Print.print("inside main");
		new Candy();
		
		Print.print("After creating Candy");
		try {
			Class.forName("Gum");
		} catch(Exception e) {
			e.printStackTrace();
		}
		
		Print.print("After Class.forName(\"Gum\")");
		new Cookie();
		Print.print("After creating Cookie");
	}
	
	
}


class Candy{
	static{
		Print.print("Loading Candy");
	}
}

class Gum{
	static{
		Print.print("Loading Gum");
	}
}

class Cookie{
	static{
		Print.print("Loading Cookie");
	}
}